package com.canbot.u05.activity.roadGuide

import android.os.Parcel
import android.os.Parcelable

/**
 * Created by zmp on 2019/7/5 9:49
 * @author zmp
 */
data class RoadGuideBean(
        var mapID: Long = -1,
        var id: Int = 0,
        var roadName: String? = null,
        var hotWord: String? = null,
        var pointOtherName: String? = null,
        var pointMapName: String? = null,
        var pointLogoPath: String? = null,
        var pointGuidePath: String? = null,
        var openGuide: Boolean = false,
        var voiceType: Int = 0,
        var voiceContent: String? = null
):Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readLong(),
            parcel.readInt(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readByte() != 0.toByte(),
            parcel.readInt(),
            parcel.readString()) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeLong(mapID)
        parcel.writeInt(id)
        parcel.writeString(roadName)
        parcel.writeString(hotWord)
        parcel.writeString(pointOtherName)
        parcel.writeString(pointMapName)
        parcel.writeString(pointLogoPath)
        parcel.writeString(pointGuidePath)
        parcel.writeByte(if (openGuide) 1 else 0)
        parcel.writeInt(voiceType)
        parcel.writeString(voiceContent)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<RoadGuideBean> {
        override fun createFromParcel(parcel: Parcel): RoadGuideBean {
            return RoadGuideBean(parcel)
        }

        override fun newArray(size: Int): Array<RoadGuideBean?> {
            return arrayOfNulls(size)
        }
    }
}